package team.fivez.defaultmanage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import team.fivez.defaultmanage.domain.Result;
import team.fivez.defaultmanage.service.RegionInfoService;
import team.fivez.defaultmanage.utils.Utils;

@CrossOrigin
@RestController
@RequestMapping("/regionInfo")
public class RegionInfoController {

    private final RegionInfoService regionInfoService;

    @Autowired

    public RegionInfoController(RegionInfoService regionInfoService) {
        this.regionInfoService = regionInfoService;
    }


    @GetMapping("/defaultSituation")
    public Result getDefaultSituation(){
        return Utils.success(regionInfoService.getRegionDefaultSituation());
    }

    @GetMapping("/redoSituation")
    public Result getRedoSituation(){
        return Utils.success(regionInfoService.getRegionRedoSituation());
    }

}
